package priv.yiyuan.example.design.visitor.node;

import priv.yiyuan.example.design.visitor.AstVisitor;

/**
 * @author YiYuan
 * @data 2025/7/30
 * @apoNote
 */
public class BinaryExpression implements AstNode {

    private String operator;

    private AstNode left;

    private AstNode right;

    public BinaryExpression(String operator, AstNode left, AstNode right) {
        this.operator = operator;
        this.left = left;
        this.right = right;
    }

    public String getOperator() {
        return operator;
    }

    public AstNode getLeft() {
        return left;
    }

    public AstNode getRight() {
        return right;
    }

    @Override
    public void accept(AstVisitor visitor) {
        visitor.visit(this);
    }
}
